class AddressBean {
  int id = DateTime.now().millisecondsSinceEpoch;
  String name = '';
  String phone = '';
  String address = '';
  bool isDefault = false;

  AddressBean.empty();

  AddressBean({this.name, this.phone, this.address, this.isDefault});

  bool infoCorrect() {
    if (name.isEmpty) return false;
    if (phone.isEmpty) return false;
    if (address.isEmpty) return false;
    return true;
  }

  AddressBean.fromJson(Map<String, dynamic> json) {
    name = json['name'];
    phone = json['phone'];
    address = json['address'];
    isDefault = json['isDefault'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['name'] = this.name;
    data['phone'] = this.phone;
    data['address'] = this.address;
    data['isDefault'] = this.isDefault;
    return data;
  }
}
